#ifndef __MY_TASK_H_
#define __MY_TASK_H_

#include "Reactor/ThreadPool.h"
#include "Reactor/TcpConnection.h"
#include "HttpRequest.h"
#include <string>
using std::string;
using TcpConnectionPtr = shared_ptr<TcpConnection>;

class MyTask
{
public:
    MyTask(const HttpRequest &httpreq, const TcpConnectionPtr &con);
    void process();

    void HttpParser(HttpRequest &http);      // 解析http请求
    void KeyRecommand(const string &sought); // 关键词推荐
    void WebPageRecommand(const string &value); // 网页搜索
private:
    TcpConnectionPtr _con;
    HttpRequest _httpreq;
};

#endif